# 列表
list1 = ['Google', 'Runoob', 1997, 2000];
list2 = [1, 2, 3, 4, 5, 6, 7];

print("list1[0]: ", list1[0])
print("list2[1:5]: ", list2[1:5])

list = ['Google', 'Runoob', 1997, 2000]
print("第三个元素为 : ", list[2])
list[2] = 2001
print("更新后的第三个元素为 : ", list[2])

list = ['Google', 'Runoob', 1997, 2000]
print(list)
del list[2]
print("删除第三个元素 : ", list)
print(len(list))
print(['hi', 'haha'] * 4)
print(list[-2])
list.reverse()
print(list)
print(list.index('Google'))
# 元组
tup1 = ('Google', 'Runoob', 1997, 2000)
tup2 = (1, 2, 3, 4, 5, 6, 7)

print("tup1[0]: ", tup1[0])
print("tup2[1:5]: ", tup2[1:5])
tup1 = (12, 34.56);
tup2 = ('abc', 'xyz')

# 修改报错
# tup1[0] = 100

# 创建一个新的元组
tup3 = tup1 + tup2;
print(tup3)

tup = ('Google', 'Runoob', 1997, 2000)
print(tup)
del tup

# 字典
dict = {'Name': 'Runoob', 'Age': 7, 'Class': 'First'}

print("dict['Name']: ", dict['Name'])
print("dict['Age']: ", dict['Age'])

dict = {'Name': 'Runoob', 'Age': 7, 'Class': 'First'}

dict['Age'] = 8;  # 更新 Age
dict['School'] = "菜鸟教程"  # 添加信息

print("dict['Age']: ", dict['Age'])
print("dict['School']: ", dict['School'])

dict = {'Name': 'Runoob', 'Age': 7, 'Class': 'First'}

del dict['Name']  # 删除键 'Name'
dict.clear()  # 清空字典
del dict  # 删除字典
dict = {'Name': 'Runoob', 'Age': 7, 'Name': '小菜鸟'}

print("dict['Name']: ", dict['Name'])
print(type(dict))
